Due to their decentralized and autonomous nature, Wireless Sensor Networks (WSNs) have been widely deployed, and this makes both efficient collective sensing and data processing possible. In particular, these networks must be secure in terms of their ability to withstand different attacks. WSNs are particularly sensitive to various forms of attack in hostile environments. This paper aims to provide a novel design based on blockchain technology for detecting and isolating malicious nodes in WSNs. In WSNs, malicious activities can have eco-centric consequences in addition to spreading false data and disrupting normal operations. Therefore, an urgent need arises for Intrusion Detection Systems (IDS) that require few resources, are effective, and are able to operate within the computational abilities of WSN nodes. The method we propose surpasses current IDS techniques by reducing the requirements for communication and computation. Above all, in comparison to traditional blockchain frameworks. The objective is to detect and eliminate compromised nodes, which can seriously affect network performance and cause sensor data to be misreported for longer periods. Chaos theory and a simplified algorithm are used to generate a validation hash. Node verification made easier by chaos theory generates a hash for verification. The simulation results confirm that our approach can accurately discover compromised nodes while optimizing resource utilization.